//
//  TuanWebViewController.m
//  LoverGo
//
//  Created by liudonghuan on 14-9-14.
//  Copyright (c) 2014年 yexiao. All rights reserved.
//

#import "TuanWebViewController.h"
#import "LGUtil.h"
@interface TuanWebViewController ()

@end

@implementation TuanWebViewController

-(id)initWithRealUrl:(NSString *)realUrl
{
    self = [super init];
    if (self) {
        _realUrl = realUrl;
        self.hidesBottomBarWhenPushed = YES;
    }
    return self;
}
-(void)loadView
{
    [self dinglan];
    _tuanWebV = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:_realUrl]];
    [self setView:_tuanWebV];
    [_tuanWebV loadRequest:request];
}
-(void)dinglan{
    UIButton * backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0,20, 20)];
    [backBtn setBackgroundImage:[UIImage imageNamed:@"btn_back.png"] forState:UIControlStateNormal];
    [backBtn addTarget:self action:@selector(dinglanBackBtn) forControlEvents:UIControlEventTouchUpInside] ;
    [backBtn setShowsTouchWhenHighlighted:YES] ;
    UIBarButtonItem *backbutton = [[UIBarButtonItem alloc]initWithCustomView:backBtn];
    self.navigationItem.leftBarButtonItem = backbutton;
    UILabel *title = [[UILabel alloc]initWithFrame:CGRectMake(90, 0, 140, 30)];
    title.textAlignment = UITextAlignmentCenter;
    title.textColor = LGCOLOR_blue;
    title.text = @"团购页面";
    self.navigationItem.titleView = title;
    
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"barBG.png"] forBarMetrics:UIBarMetricsDefault];
}
-(void)dinglanBackBtn{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [MobClick beginLogPageView:@"团购页面"];
}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:@"团购页面"];
}

@end
